package com.jlpay.openapi.demo.openmerch.query;

import com.jlpay.open.jlpay.sdk.java.model.openmerch.query.request.MerchBaseInfoQueryRequest;
import com.jlpay.open.jlpay.sdk.java.model.openmerch.query.response.MerchBaseInfoQueryResponse;
import com.jlpay.open.jlpay.sdk.java.utils.json.JsonUtils;
import com.jlpay.openapi.demo.JlpayOpenApiService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 商户基本信息查询
 * @author chenjunhong
 * @date 2024/4/11
 */
public class MerchBaseInfoQueryService {
    private static final Logger LOGGER = LoggerFactory.getLogger(MerchBaseInfoQueryService.class);

    public static void main(String[] args) {
        MerchBaseInfoQueryRequest merchBaseInfoQueryRequest = buildMerchBaseInfoQueryRequest();
        MerchBaseInfoQueryResponse merchBaseInfoQueryResponse = JlpayOpenApiService.openMerchWithCryptoService()
                .post(merchBaseInfoQueryRequest, MerchBaseInfoQueryResponse.class);
        LOGGER.info("商户基本信息查询响应:{}", JsonUtils.toString(merchBaseInfoQueryResponse));
    }

    private static MerchBaseInfoQueryRequest buildMerchBaseInfoQueryRequest() {
        MerchBaseInfoQueryRequest merchBaseInfoQueryRequest = new MerchBaseInfoQueryRequest();
        // 商户号
        merchBaseInfoQueryRequest.setMerchNo("849584358140108");
        return merchBaseInfoQueryRequest;
    }
}
